/**
 * 
 */
package socns.modules.comment.utils;

import org.springframework.beans.BeanUtils;

import socns.modules.account.utils.AccountBeanUtils;
import socns.modules.comment.persist.entity.CommentPO;
import socns.modules.comment.pojos.Comment;

/**
 * @author langhsu
 *
 */
public class CommentBeanUtils {
	private static String[] COMMENT_IGNORE = new String[]{"author"};
	
	public static Comment copy(CommentPO po) {
		Comment ret = new Comment();
		BeanUtils.copyProperties(po, ret, COMMENT_IGNORE);
		
		if (po.getAuthor() != null) {
			ret.setAuthor(AccountBeanUtils.copy(po.getAuthor()));
		}
		return ret;
	}
}
